package com.cw.DesignModel23.Ceational.PrototypePattern.clone3;

import java.io.Serializable;

/**
 * 原型模式（深拷贝）
 */
public class DeepCloneableTarget implements Serializable, Cloneable {

    private static final long serialVersionUID = 1L;

    private String cloneName;

    private String cloneClass;

    /**
     * 构造器
     * @param cloneName
     * @param cloneClass
     */
    public DeepCloneableTarget(String cloneName, String cloneClass) {
        this.cloneName = cloneName;
        this.cloneClass = cloneClass;
    }

    /**
     * 因为该类的属性，都是String ， 因此我们这里使用默认的clone完成即可
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

